<form id="frm_admin_edit" method="POST" action="<?php echo $save_action; ?>">
    <?php $this->load->view('site/admin/message'); ?>
    <input id="entity_id" type="hidden" name="id" value="<?php echo $admin->id; ?>" />
    <div class="clearfix auto_height mb_10">
        <?php $buttons = $this->load->view('admin/site/admin/buttons', null, true); echo $buttons ?>
    </div>
    <div class="form_block">
        <div class="block_header">
            Thông tin căn bản
        </div>
        <div class="block_content">
            <table cellpadding="0px" cellspacing="0px">
                <tr>
                    <td class="frm_label">Tên đăng nhập(*)</td>
                    <td class="frm_field">
                        <input type="text" class="std_input required" name="data[username]" value="<?php echo $admin->username; ?>" />
                    </td>
                </tr>
                <tr>
                    <td class="frm_label">Tên người dùng(*)</td>
                    <td class="frm_field">
                        <input type="text" class="std_input required" name="data[name]" value="<?php echo $admin->name; ?>" />
                    </td>
                </tr>
                <tr>
                    <td class="frm_label">Kích hoạt(*)</td>
                    <td class="frm_field">
                        <label>
                            <input value="1" <?php if ($admin->is_active == 1) :?>checked="checked"<?php endif; ?> type="checkbox" class="std_chk" name="data[is_active]" />
                            <span>Có / Không</span>
                        </label>
                    </td>
                </tr>
                <tr>
                    <td class="frm_label">Là tài khoản hệ thống(*)</td>
                    <td class="frm_field">
                        <label>
                            <input value="1" <?php if ($admin->is_system == 1) :?>checked="checked"<?php endif; ?> type="checkbox" class="std_chk" name="data[is_system]" />
                            <span>Có / Không</span>
                        </label>
                    </td>
                </tr>
                <tr>
                    <td class="frm_label">Chức vụ(*)</td>
                    <td class="frm_field">
                        <select name="data[role_id]" style="width: 100%">
                            <?php foreach ($roles as $role) :?>
                            <option <?php if ($role->id == $admin->role_id) :?>selected="selected"<?php endif; ?> value="<?php echo $role->id; ?>"><?php echo $role->name; ?></option>
                            <?php endforeach; ?>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="frm_label">Mật khẩu(*)</td>
                    <td class="frm_field">
                        <input type="password" class="std_input" name="data[password]" />
                    </td>
                </tr>
                <tr>
                    <td class="frm_label">Điện thoại</td>
                    <td class="frm_field">
                        <input type="text" class="std_input required" name="data[phone]" value="<?php echo $admin->phone; ?>" />
                    </td>
                </tr>
                <tr>
                    <td class="frm_label">Email(*)</td>
                    <td class="frm_field">
                        <input type="text" class="std_input required" name="data[email]" value="<?php echo $admin->email; ?>" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div class="clearfix auto_height">
        <?php echo $buttons; ?>
    </div>
</form>
<script type="text/javascript">
    $("select").selectBox("enable");
</script>